﻿<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="/HR_SYSTEM/Styles/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="/HR_SYSTEM/Styles/admin-all.css" />
    <script type="text/javascript" src="/HR_SYSTEM/Scripts/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="/HR_SYSTEM/Scripts/jquery-ui-1.8.22.custom.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/HR_SYSTEM/Styles/ui-lightness/jquery-ui-1.8.22.custom.css" />
    <script type="text/javascript" src="/HR_SYSTEM/Scripts/tip.js"></script>
    <script type="text/javascript">
    	function sendEmail() {
    		document.forms["form_add"].submit();
    	}
    	function verfiyEmailAddress() {
    		var email = form_add.to.value;
    		var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+\.([a-zA-Z0-9_-])+$/;
    		flag = pattern.test(email);
    		if(flag==true) {
    			document.forms["form_add"].submit();
    		} else {
    			alert("请输入正确邮箱地址");
    			return false;
    		}
    	}
    </script>
</head>
<body>
    <div></div>
    <div class="alert alert-info">当前位置<b class="tip"></b>邮件发送<b class="tip"></b>公司邮件发送</div>
     <form action="<c:url value='/EmailServlet?method=sendEmail'/>" name="form_add" method="post">
     <table class="table table-striped table-bordered table-condensed">
     	<tr>
     		<span><font color="bule">${msg}</font></span>
     	</tr>
        <tr>
            <td>邮件使用主机:</td>
            <td>${host}</td>
            <td></td>
        </tr>
        <tr>
            <td>邮件发送姓名:</td>
            <td>${uname}</td>
            <td></td>
 		</tr>
 		<tr>
            <td>本地邮件地址：</td>
            <td>${from}</td>
 			<td></td>
 		</tr>
 		<tr>
            <td>邮件发送地址：</td>
            <td><input type="text" id="to" name="to" value="${to}"/></td>
 			<td></td>
 		</tr>
       	<tr>
            <td>邮件主题：</td>
            <td>
            	<input type="text" name="subject"/>
            </td>
 			<td></td>
 		</tr>
 		<tr>
            <td>邮件内容：</td>
            <td>
            	<textarea rows="5" cols="20" name="content">
            	</textarea>
            </td>
 			<td></td>
 		</tr>
 		<tr>
 			<td colspan="2">
                <input class="btn btn-inverse" id="button" type="button" onclick="verfiyEmailAddress()" value="发送" />&nbsp;
                <input class="btn btn-inverse" type="reset" value="清空" />&nbsp;
            </td>
 		</tr>
    </table>
    </form>
</body>
</html>
